package com.okq.service.Impl;

import com.okq.dao.NoticeDao;
import com.okq.entity.Notice;
import com.okq.service.INoticeService;
import com.okq.util.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 描述 : 公告通知接口实现类
 * 作者 : zdl
 * 日期 : 2017/6/29 11:40
 */
@Transactional
@Service
public class NoticeServiceImpl implements INoticeService {

    @Autowired
    private NoticeDao noticeDao;

    @Override
    public void saveNotice(Notice notice) {
        noticeDao.saveNotice(notice);
    }

    @Override
    public void deleteNotice(Notice notice) {
        noticeDao.deleteNotice(notice);
    }

    @Override
    public void updateNotice(Notice notice) {
        noticeDao.updateNotice(notice);
    }

    @Override
    public void saveOrUpdateNotice(Notice notice) {
        noticeDao.saveOrUpdateNotice(notice);
    }

    @Override
    public Notice getNoticeById(String id) {
        return noticeDao.getNoticeById(id);
    }

    @Override
    public List<Notice> listAllNotice() {
        return noticeDao.listAllNotice();
    }

    @Override
    public Page<Notice> pageByNotice(Page<Notice> page, Notice notice) {
        return noticeDao.pageByNotice(page, notice);
    }

    @Override
    public Notice getLastTop(String comCode) {
        return noticeDao.getLastTop(comCode);
    }

    @Override
    public List<Notice> listNoOverdueNotice() {
        return noticeDao.listNoOverdueNotice();
    }
}
